using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_BASE_CostCenterMap : EntityTypeConfiguration<t_BASE_CostCenter>
    {
        public t_BASE_CostCenterMap()
        {
            // Primary Key
            this.HasKey(t => t.FItemID);

            // Properties
            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FNumber)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FRemark)
                .HasMaxLength(255);

            this.Property(t => t.FBrNO)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FShortNumber)
                .HasMaxLength(80);

            this.Property(t => t.FModifyTime)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            // Table & Column Mappings
            this.ToTable("t_BASE_CostCenter");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FAcctID).HasColumnName("FAcctID");
            this.Property(t => t.FDeptID).HasColumnName("FDeptID");
            this.Property(t => t.FRemark).HasColumnName("FRemark");
            this.Property(t => t.FBrNO).HasColumnName("FBrNO");
            this.Property(t => t.FParentID).HasColumnName("FParentID");
            this.Property(t => t.FDeleted).HasColumnName("FDeleted");
            this.Property(t => t.FShortNumber).HasColumnName("FShortNumber");
            this.Property(t => t.FModifyTime).HasColumnName("FModifyTime");
        }
    }
}
